# Process this file with autoconf to produce a configure script.

# Prelude.
AC_INIT([roboboca], [0.1], [diogofsr AT grad.icmc.usp.br])

# unique source file --- primitive safety check 
AC_CONFIG_SRCDIR([src/main.c])

# place to put some extra build scripts installed
AC_CONFIG_AUX_DIR([build-aux])

# fairly severe build strictness
# change foreign to gnu or gnits to comply with gnu standards
AM_INIT_AUTOMAKE([-Wall -Werror foreign])

# Checks for programs.
AC_PROG_LIBTOOL
AC_PROG_CC

# Checks for libraries.

AC_ARG_WITH(CHECK, "For auto unit tests", [PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])] )
AC_SUBST([CHECK_LIBS])

PKG_CHECK_MODULES([PLAYER], [playerc >= 2])
AC_SUBST([PLAYER_LIBS])
AC_SUBST([PLAYER_CFLAGS])

AC_CHECK_LIB([pthread],[pthread_create], [],[AC_MSG_ERROR([You need pthread.])])
AC_SUBST([PTHREAD_LIBS])

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h])

# Checks for typedefs, structures, and compiler characteristics.

# Checks for library functions.
AC_FUNC_MALLOC

# Output files
AC_CONFIG_HEADERS([config.h])

AC_CONFIG_FILES([Makefile
                 lib/Makefile
                 src/Makefile
                 tests/Makefile])
AC_OUTPUT
